//    Copyright (C) 2013  <lugocreation@gmail.com>
//
//    This program is free software: you can redistribute it and/or modify
//    it under the terms of the GNU General Public License as published by
//    the Free Software Foundation, either version 3 of the License, or
//    (at your option) any later version.
//
//    This program is distributed in the hope that it will be useful,
//    but WITHOUT ANY WARRANTY; without even the implied warranty of
//    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//    GNU General Public License for more details.
//
//    You should have received a copy of the GNU General Public License
//    along with this program.  If not, see <http://www.gnu.org/licenses/>.
package org.jpgolay.me.stock.log;

import java.io.Serializable;
import java.math.BigDecimal;

public class LogStock
        implements Serializable {

    public LogStock() {
    }

    public LogStock(Integer id, String operation, String vers, BigDecimal quantity, String date, String itemId, Integer batchId,
            String notes, String de, String updateLastTime, String userId) {
        setId(id);
        setOperation(operation);
        setVers(vers);
        setQuantity(quantity);
        setDate(date);
        setItemId(itemId);
        setBatchId(batchId);
        setNotes(notes);
        setDe(de);
        setUpdateLastTime(updateLastTime);
        setUserId(userId);
    }

    public LogStock(LogStock batch) {
        setId(batch.getId());
        setOperation(batch.getOperation());
        setVers(batch.getVers());
        setQuantity(batch.getQuantity());
        setDate(batch.getDate());
        setItemId(batch.getItemId());
        setBatchId(batch.getBatchId());
        setNotes(batch.getNotes());
        setDe(batch.getDe());
        setUpdateLastTime(batch.getUpdateLastTime());
        setUserId(batch.getUserId());
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getOperation() {
        return operation;
    }

    public void setOperation(String operation) {
        this.operation = operation;
    }

    public String getVers() {
        return vers;
    }

    public void setVers(String vers) {
        this.vers = vers;
    }

    public BigDecimal getQuantity() {
        return quantity;
    }

    public void setQuantity(BigDecimal quantity) {
        this.quantity = quantity;
    }

    public String getDate() {
        return date;
    }

    public void setDate(String date) {
        this.date = date;
    }

    public String getItemId() {
        return itemId;
    }

    public void setItemId(String itemId) {
        this.itemId = itemId;
    }

    public Integer getBatchId() {
        return batchId;
    }

    public void setBatchId(Integer batchId) {
        this.batchId = batchId;
    }

    public String getNotes() {
        return notes;
    }

    public void setNotes(String notes) {
        this.notes = notes;
    }

    public String getDe() {
        return de;
    }

    public void setDe(String de) {
        this.de = de;
    }

    public String getUpdateLastTime() {
        return updateLastTime;
    }

    public void setUpdateLastTime(String updateLastTime) {
        this.updateLastTime = updateLastTime;
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public String toString() {
        StringBuffer str = new StringBuffer("{");
        str.append("id=" + getId() + " " + "operation=" + getOperation() + " " + "vers=" + getVers() + " " + "quantity=" + getQuantity() + " " + "date=" + getDate() + " " + "itemId=" + getItemId() + " " + "batchId=" + getBatchId() + " " + "notes=" + getNotes() + " " + "designation=" + getDe() + " " + "updateLastTime=" + getUpdateLastTime() + " " + "userId=" + getUserId());
        str.append('}');
        return str.toString();
    }

    public boolean equals(Object pOther) {
        if (pOther instanceof LogStock) {
            LogStock lTest = (LogStock) pOther;
            boolean lEquals = true;
            if (id == null) {
                lEquals = lEquals && lTest.id == null;
            } else {
                lEquals = lEquals && id.equals(lTest.id);
            }
            if (operation == null) {
                lEquals = lEquals && lTest.operation == null;
            } else {
                lEquals = lEquals && operation.equals(lTest.operation);
            }
            if (vers == null) {
                lEquals = lEquals && lTest.vers == null;
            } else {
                lEquals = lEquals && vers.equals(lTest.vers);
            }
            if (quantity == null) {
                lEquals = lEquals && lTest.quantity == null;
            } else {
                lEquals = lEquals && quantity.equals(lTest.quantity);
            }
            if (date == null) {
                lEquals = lEquals && lTest.date == null;
            } else {
                lEquals = lEquals && date.equals(lTest.date);
            }
            if (itemId == null) {
                lEquals = lEquals && lTest.itemId == null;
            } else {
                lEquals = lEquals && itemId.equals(lTest.itemId);
            }
            if (batchId == null) {
                lEquals = lEquals && lTest.batchId == null;
            } else {
                lEquals = lEquals && batchId.equals(lTest.batchId);
            }
            if (notes == null) {
                lEquals = lEquals && lTest.notes == null;
            } else {
                lEquals = lEquals && notes.equals(lTest.notes);
            }
            if (de == null) {
                lEquals = lEquals && lTest.de == null;
            } else {
                lEquals = lEquals && de.equals(lTest.de);
            }
            if (updateLastTime == null) {
                lEquals = lEquals && lTest.updateLastTime == null;
            } else {
                lEquals = lEquals && updateLastTime.equals(lTest.updateLastTime);
            }
            if (userId == null) {
                lEquals = lEquals && lTest.userId == null;
            } else {
                lEquals = lEquals && userId.equals(lTest.userId);
            }
            return lEquals;
        } else {
            return false;
        }
    }

    public int hashCode() {
        int result = 17;
        result = 37 * result + (id == null ? 0 : id.hashCode());
        result = 37 * result + (operation == null ? 0 : operation.hashCode());
        result = 37 * result + (vers == null ? 0 : vers.hashCode());
        result = 37 * result + (quantity == null ? 0 : quantity.hashCode());
        result = 37 * result + (date == null ? 0 : date.hashCode());
        result = 37 * result + (itemId == null ? 0 : itemId.hashCode());
        result = 37 * result + (batchId == null ? 0 : batchId.hashCode());
        result = 37 * result + (notes == null ? 0 : notes.hashCode());
        result = 37 * result + (de == null ? 0 : de.hashCode());
        result = 37 * result + (updateLastTime == null ? 0 : updateLastTime.hashCode());
        result = 37 * result + (userId == null ? 0 : userId.hashCode());
        return result;
    }
    private Integer id;
    private String operation;
    private String de;
    private String vers;
    private BigDecimal quantity;
    private String date;
    private String itemId;
    private Integer batchId;
    private String notes;
    private String updateLastTime;
    private String userId;
}
